/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */

package com.click.app.service.impl;

import com.click.app.dao.SalaryDao;
import com.click.app.model.Employee;
import com.click.app.model.Salary;
import com.click.app.service.SalaryManager;
import java.util.ArrayList;
import java.util.List;

/**
 *
 * @author ariel
 */
public class SalaryManagerImpl extends GenericManagerImpl<Salary, Long> implements SalaryManager {

    SalaryDao SalaryDao;

    public SalaryManagerImpl(SalaryDao SalaryDao) {
        super(SalaryDao);
        this.SalaryDao = SalaryDao;
    }

    public List<Salary> findByEmployee(Employee employee) {
        List<Salary> salarys = SalaryDao.findByEmployee(employee);
        if (salarys==null){
            salarys = new ArrayList<Salary>();
        }
        return salarys;
    }

    public Salary findByEmployeePay(Employee employee) {
        return SalaryDao.findByEmployeePay(employee);
    }

}
